package com.zgzg.shop.pay.business.common.service.impl;

import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zgzg.shop.pay.base.entity.DdwxMember;
import com.zgzg.shop.pay.base.utils.InstanceConvertUtil;
import com.zgzg.shop.pay.business.common.dao.DdwxMemberMapper;
import com.zgzg.shop.pay.business.common.dto.DdwxMemberDTO;
import com.zgzg.shop.pay.business.common.service.DdwxMemberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class DdwxMemberServiceImpl extends ServiceImpl<DdwxMemberMapper, DdwxMember> implements DdwxMemberService {

    @Autowired
    private DdwxMemberMapper ddwxMemberMapper;


    @Override
    public DdwxMemberDTO findById(Long id) {
        DdwxMember ddwxMember = new LambdaQueryChainWrapper<>(baseMapper)
                .eq(DdwxMember::getId, id)
                .one();
        return InstanceConvertUtil.convertObject(ddwxMember, DdwxMemberDTO.class);
    }
}
